<?php
if (!defined('APP_ID')) { die('No direct script access allowed'); }

/**
 * Tools class
 */
class Tools {
	/**
	 * Redirect
	 */
	function redirect($url) {
		if (!headers_sent()) {
			//@header($_SERVER['SERVER_PROTOCOL'] . ' 200 OK');
			@header('Location: ' . $url);
		} else {
			echo '<script type="text/javascript">';
			echo 'location.replace("' . $url . '");';
			echo '</script>';
			echo '<noscript>';
			echo '<meta http-equiv="refresh" content="0;url=' . $url . '" />';
			echo '</noscript>';
		}
		exit;
	}
}
